<?php echo $header; ?>
<style>.list tbody td{background:none;}</style>
<div id="content">
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/customer.png" alt="" /> Thống kê theo tháng</h1>
    </div>
    <div class="content">
	<div class="overview" style="width:45%;">
        <div class="dashboard-heading">Tìm kiếm & Thành viên</div>
        <div class="dashboard-content" style="min-height:initial;padding:5px;font-weight:bold">
         <table class="list" style="margin-bottom:0">
          <tbody>
		   <thead>
				<tr>
				   <td class="left">Ngày bắt đầu</td>
				   <td class="left">Ngày kết thúc</td>
					<td class="left"></td>
				</tr>
			  </thead>
            <tr class="filter">
              <td><input type="text" name="filter_date_start" value="" size="25" class="date" /></td>
              <td><input type="text" name="filter_date_end" value="" size="25" class="date" /></td>
              <td align="right"><a onclick="filter();" class="button">Tìm</a></td>
			</tr> 
          </tbody>
        </table>
        </div>
      </div>
	  <div id="box-ajax"></div>

    </div>
  </div>
</div>
<script type="text/javascript"><!--
function filter() {
	var check = true;
	url = 'index.php?route=sale/thongketheothang/getList&token=<?php echo $token; ?>';
	var filter_date_start = $('input[name=\'filter_date_start\']').attr('value');
	var filter_date_end = $('input[name=\'filter_date_end\']').attr('value');
	if(filter_date_start == ''){
		$('input[name=\'filter_date_start\']').css('background-color','#D62340');
		check = false;
	} else {$('input[name=\'filter_date_start\']').css('background-color','#fff');}

	if(filter_date_end == ''){
		$('input[name=\'filter_date_end\']').css('background-color','#D62340');
		check = false;
	} else {$('input[name=\'filter_date_end\']').css('background-color','#fff');}
	if(check == true){
		url += '&filter_date_start=' + encodeURIComponent(filter_date_start);
		url += '&filter_date_end=' + encodeURIComponent(filter_date_end);
		$.ajax({
			url: url,
			type: 'GET',
			dataType: 'html',
			success: function(html) {
				if(html){
					$('#box-ajax').html(html);
					$('#button-transaction').click(function(){
						activeTransaction();
					});
				}
			}
		});
	}
}
//--></script>
<script type="text/javascript"><!--
$(document).ready(function() {
	$('.date').datepicker({dateFormat: 'yy-mm-dd'});
});
//--></script>
<?php echo $footer; ?> 